﻿using System;

namespace SmartFront.Toolkit.ActionFramework
{
    /// <summary>
    /// Dependent Action Attribute should mark to all actions which effect other actions cache
    /// Generally this attribute needs to mark to the actions which perform Add/Edit/Delete operation
    /// and so Base class will expire those actions cache when attribute mark action will resturn success code.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
    public class DependentActionAttribute : Attribute
    {
        #region Properties

        /// <summary>
        /// Gets or sets the type of the dependent action.
        /// </summary>
        /// <value>The type of the dependent action.</value>
        public Type DependentActionType { get; private set; }

        #endregion

        #region Constructor

        /// <summary>
        /// Initializes a new instance of the <see cref="DependentActionAttribute"/> class.
        /// </summary>
        /// <param name="dependentActionType">Type of the dependent action.</param>
        public DependentActionAttribute(Type dependentActionType)
        {
            this.DependentActionType = dependentActionType;
        }

        #endregion
    }
}